package inner_package;

public class MemberClass {
    private String msg = "Outer中的msg";

    class Inner {
        private int num = 10;
        private String mag = "成员内部类的msg";
        public void test() {
            System.out.println(msg);
            System.out.println(MemberClass.this.msg);
        }
    }

    public static void test1() {
//        Inner inner = new Inner(); // 外部类的静态方法不能直接创建成员内部类
    }

    public void fun() {
        Inner inner = new Inner(); // 外部类的内部产生成员内部类对象
        System.out.println(inner.num);
    }
}

class Test {
    public static void main(String[] args) {
        MemberClass.Inner inner = new MemberClass().new Inner();
    }
}
